package demo1;

public class java8 {
	public static boolean contains(int[] arr, int target) {  
        for (int num : arr) {  
            if (num == target) {  
                return true;  
            }  
        }  
        return false;  
    }
	public static int[] copyRange(int[] arr, int start, int end) {  
         
        int[] newArr = new int[end - start];  
        for (int i = start, j = 0; i < end; i++, j++) {  
            newArr[j] = arr[i];  
        }  
        return newArr;  
    }
	public static void main(String[] agrs){
		int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9};  
        int[] copiedArr = copyRange(arr, 2, 5); 
        for (int num : copiedArr) {  
            System.out.print(num + " ");  
        }
	}
}
